import App from './App'
import * as Pinia from 'pinia';
import persist from "pinia-plugin-persistedstate"

import aQuasar from '@/uni_modules/amtf-uni-quasar/index.js'
import config from './config.js'

// import {
// 	Quasar,
// 	QIcon,
// 	QExpansionItem,
// 	QBtn,
// } from 'quasar'

import stopPropagation from "@/amtf/amtf-ly/directives/stop-propagation"
import afocus from "@/amtf/amtf-ly/directives/afocus"
import enterKey from "@/amtf/amtf-ly/directives/enter-key"

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	const pinia = Pinia.createPinia()
	pinia.use(persist)
	app.use(pinia);

	app.use(aQuasar, config)

	// app.use(Quasar)
	// app.component('q-icon', QIcon)
	// app.component('aq-expansion-item', QExpansionItem)
	// app.component('aq-btn', QBtn)


	app.directive('stop-propagation', stopPropagation)
	app.directive('enter-key', enterKey)
	app.directive('afocus', afocus)


	return {
		app
	}
}
// #endif